﻿@using Janus.Mes.VO
@using Janus.Mes.DTO
@using Janus.Cores.Resources
@model List<VwCalendarSumVO>
@{
    int i = 1;
    Layout = null;
    VwCalendarSumDTO dto = ViewData["SearchParma"] as VwCalendarSumDTO ?? new VwCalendarSumDTO();
    var SearchParma = AutoMapper.Mapper.DynamicMap<VwCalendarSumVO>(dto);
    List<SelectListItem> lstYears = new List<SelectListItem>();
    int curYear = DateTime.Now.Year;
    for (int y = curYear + 1; y > DateTime.Now.Year - 6; y--)
    {
        lstYears.Add(new SelectListItem { Text = y.ToString(), Value = y.ToString() });
    }
}

<form id="pagerForm" method="get" action="BaseData/Calendar/index?action=page&OpID=@ViewData["OperateID"]">
    <input type="hidden" name="pageNum" value="1" />
    <input type="hidden" name="numPerPage" value="@ViewData["pageSize"]" />
    <input type="hidden" name="RowCount" value="@ViewData["RowCount"]" />
    <input type="hidden" name="Year" value="@SearchParma.Year" />
    <input type="hidden" name="WorkCCode" value="@SearchParma.WorkCCode" />
</form>
<div class="pageHeader">
    <form onsubmit="return navTabSearch(this);" id="Form_@ViewData["CurrentController"]" action="BaseData/Calendar/index?action=search&OpID=@ViewData["OperateID"]"
          method="post">
        <div class="searchBar">
            <table class="searchContent">
                <tr>
                    <td>
                        年份：
                    </td>
                    <td>
                        @Html.DropDownList("Year", lstYears, "", new { @class = "WidthAsInputCombox", selectedvalue = SearchParma.Year })
                    </td>
                    <td>
                        工作中心：
                    </td>
                    <td>
                        <select id="WorkCCode" class="WidthAsInputCombox">
                            <option value=""></option>
                            <option value="CFEFDE2F-B80A-4765-957E-762E880D2BD3">生产一课生产一课生产一课生产一课生产一课</option>
                            <option value="67A0BED6-E21C-4A92-AFF6-FB2D2273E910">生产二课</option>
                        </select>
                    </td>
                    <td align="right">
                        <div class="subBar">
                            <ul>
                                <li>
                                    <div class="buttonActive">
                                        <div class="buttonContent">
                                            <button type="submit" name="submit">
                                                查询
                                            </button>
                                        </div>
                                    </div>
                                </li>
                            </ul>
                        </div>
                    </td>
                </tr>
            </table>
        </div>
    </form>
</div>
<div class="pageContent">
    @Html.Partial("Buttons", ViewData["CurrentPageButtons"])
    <table class="list" layouth="90" style="width:100%;">
        <thead>
            <tr class="header">
                <th>序号</th>
                <th>年份</th>
                <th>工作中心</th>
                <th>全年(天)</th>
                <th>工作日(天)</th>
                <th>周末假日(天)</th>
                <th>法定假日(天)</th>
                <th>调休(天)</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr target="Calendar_id" rel="@item.Year/@item.WorkCCode/@item.WorkCName">
                    <td>@i</td>
                    <td>@item.Year</td>
                    <td>@item.WorkCName</td>
                    <td>@item.YearDayTotal</td>
                    <td>@item.WorkDayTotal</td>
                    <td>@item.WeekDayTotal</td>
                    <td>@item.HolidayTotal</td>
                    <td>@item.DaysOffTotal</td>
                </tr>
                i++;
            }
            @if (Model == null || Model.Count < 1)
            {
                <tr>
                    <td colspan="8">@ResourcesManager.CldrNoDateTip</td>
                </tr>
            }
        </tbody>
    </table>
</div>
@Html.Partial("PageBar")
